package ai.assist.common.businesss.mongo.entity;

import com.anwen.mongo.annotation.ID;
import com.anwen.mongo.annotation.collection.CollectionField;
import com.anwen.mongo.annotation.collection.CollectionName;
import com.anwen.mongo.enums.IdTypeEnum;
import ai.assist.common.vo.admin.PermissionRespNode;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 系统角色
 * @TableName sys_role
 */
@CollectionName(value ="sys_role")
@Data
public class SysRole implements Serializable {

    @ID(type = IdTypeEnum.OBJECT_ID)
    @CollectionField("_id")
    private String id;

    /**
     * 角色名称
     */
    @CollectionField(value = "name")
    private String name;

    /**
     *
     */
    @CollectionField(value = "description")
    private String description;

    /**
     * 状态(1:正常0:弃用)
     */
    @CollectionField(value = "status")
    private Integer status;

    /**
     * 创建时间
     */
    @CollectionField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @CollectionField(value = "update_time")
    private Date updateTime;

    /**
     * 是否删除(1未删除；0已删除)
     */
    @CollectionField(value = "deleted")
    private Boolean deleted;

    /**
     * 乐观锁
     */
    @CollectionField(value = "version_no")
    private Integer versionNo;

    @CollectionField(exist = false)
    private List<PermissionRespNode> permissionRespNodes;

    @CollectionField(exist = false)
    private List<String> permissions;

    @CollectionField(exist = false)
    private static final long serialVersionUID = 1L;
}
